<template>
  <!-- 表格 -->
  <el-table class="pageTableClass" :data="taskNoPage" height="calc(100vh - 380px)" :loading="isLoading">
    <el-table-column label="序号" align="center" width="70">
      <template #default="scope">
        {{ (paginationParams.current - 1) * paginationParams.pageSize + scope.$index + 1 }}
      </template>
    </el-table-column>
    <el-table-column prop="code" min-width="150" label="维修编号" align="center"/>
    <el-table-column prop="equipmentCode" min-width="200" label="设备编码" align="center"/>
    <el-table-column prop="organizationName" min-width="200" label="所属部门" align="center"/>
    <el-table-column prop="startTime" min-width="200" label="实际开始时间" align="center"/>
    <el-table-column prop="finishTime" min-width="200" label="实际结束时间" align="center"/>
    <el-table-column prop="malfunctionName" min-width="100" label="故障类型" align="center"/>
    <el-table-column prop="description" min-width="180" label="故障内容" align="center"/>
    <el-table-column prop="causeAnalysis" min-width="180" label="原因分析" align="center"/>
    <el-table-column prop="handleType" min-width="180" label="处理方式" align="center"/>
<!--    <el-table-column prop="malfunctionProcedure" min-width="180" label="维修过程" align="center"/>-->
<!--    <el-table-column prop="replacementPart" min-width="180" label="备件更换情况" align="center"/>-->
    <el-table-column prop="result" min-width="180" label="维修结果" align="center"/>
    <el-table-column prop="maintenanceUserName" min-width="180" label="维修人" align="center"/>
    <el-table-column prop="createTime" min-width="180" label="报修时间" align="center"/>
    <el-table-column prop="createUser" min-width="180" label="报修人" align="center"/>
  </el-table>
  <div class="pagePagination">
    <el-pagination background v-model:current-page="paginationParams.current"
                   v-model:page-size="paginationParams.pageSize" layout="total, sizes, prev, pager, next"
                   :total="pageTotal"
                   @size-change="handleSizeChange" @current-change="handleCurrentChange"/>
  </div>

</template>

<script setup>
import {defineProps, ref, onMounted} from 'vue';
import {ElMessage} from 'element-plus';

const dialogVisible = ref(false);
const form = ref({});
const formLabelWidth = ref('120px');
const contentDialog = ref([]);
const props = defineProps({
  paginationParams: Object,
  onSubmit: Function,
  handleSizeChange: Function,
  handleCurrentChange: Function,
  taskNoPage: Array,
  pageTotal: Number,
  equipmentData: Object,
  fetchPage: Function,
  handleEdit: Function,
  handleDel: Function,
  faultTypeOptions: Array
});


</script>

<style scoped>
.pageTableClass {
  width: 100%;
}

.pagePagination {
  margin-top: 20px;
  text-align: center;
}
</style>